import 'package:dmz/base/widget/defult_widget.dart';
import 'package:dmz/business/mine/widget/seting_repair_widgets.dart';
import 'package:dmz/utils/keyboard_util.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import '../../../base/pageWidget/base_stateful_widget.dart';
import '../controller/seting_repair_controller.dart';
import '../widget/seting_widgets.dart';

class AddNewRepairPgae extends BaseStatefulWidget<SetingRepairController> {
  const AddNewRepairPgae({super.key});

  @override
  String titleString() => '在线报修'.tr;

  @override
  bool delectControll() => false;

  @override
  get updateId => 'addRepair';

  @override
  Widget buildContent(BuildContext context) {
    return ListView(children: [
      SetRepairWidgets.addRepairTopWidget(
          controller.addRepairContent, (tag) => controller.addTopSelect(tag)),
      SetRepairWidgets.inputWidget(
          controller.addNewCT, (value) => controller.inputChange()),
      SetingWidgets.imageSelectWidget(
          '请提供问题截图'.tr,
          controller.imagesDatas,
          controller.selectImages,
          (index) => controller.cleanSelect(index)).marginOnly(top: 54.sp),
      DefaultBtn(click: () => controller.updataNewRepair(), title: '提交报修'.tr)
          .marginOnly(top: 118.sp, bottom: 112.sp, left: 32.sp, right: 32.sp)
    ]).addGestureDetector(() => KeyboardUtils.hideKeyboardGex());
  }
}
